<template>
	<view>
		<view class="list">
			<view class="list-item" @tap="cheackVision()">
				当前版本 {{verson}}
			</view>
			<view @tap="logoutButton" class="list-item">
				退出登录
			</view>
		</view>
	</view>
</template>

<script>
	// #ifdef APP-PLUS
	import checkappupdate from '@/js_sdk/wonyes-checkappupdate/wonyes/checkappupdate.js'
	// #endif
	export default {
		data() {
			return {
				show: false,
				verson: "1.0.0",
				button: [{
						text: '取消',
						backgroundColor: '#E6E6E6',
						fontColor: '#333',
						plain: true,
						shape: 'round'
					},
					{
						text: '确定',
						backgroundColor: 'tn-bg-indigo',
						fontColor: '#FFFFFF'
					}
				]
			}
		},
		onLoad() {
			// #ifdef APP-PLUS
			this.verson = plus.runtime.version
			//#endif
		},
		methods: {
			logoutButton(e) {
				console.log(e)
				if (e.index == 0) {
					this.show = false
				} else {
					uni.setStorageSync("gtPdaToken", "")
					uni.reLaunch({
						url: "/pages/index/index"
					})
				}
			},
			cheackVision() {
				// #ifdef APP-PLUS
				checkappupdate.check({
					title: "检测到有新版本！",
					content: "请升级app到最新版本！",
					canceltext: "暂不升级",
					oktext: "立即升级",
					// api: 'http://exam.wonyes.org/update.php',
					barbackground: "rgba(50,50,50,0.8)", //进度条背景色，默认灰色，可自定义rgba形式色值
					barbackgroundactive: "rgba(32,165,58,1)" //进度条前景色色，默认绿色，可自定义rgba形式色值
				})
				// #endif
			}

		}
	}
</script>

<style scoped lang="scss">
	.list {
		padding: 20rpx 20rpx;

		.list-item {
			border-bottom: 1rpx solid #e1e1e1;
			padding: 20rpx 0;
			color: #666;
			font-size: 30rpx;
		}
	}
</style>